#!/bin/bash

DOTFILE="depgraph.dot"
PNGFILE="depgraph.png"

# base stuff
echo "digraph test {" > "${DOTFILE}"

# generate the base file
clisp analyze.lisp ${*} | \
	grep -A 999999 "Defining domain ..." | tail -n +2 | \
	sort | uniq >> "${DOTFILE}"

# finish
echo "}" >> "${DOTFILE}"

dot -Tpng:gd "${DOTFILE}" > "${PNGFILE}"
